home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-01 | 5.0 KB | 305 lines | [TEXT/MPS ] |
- ;
- ; File: FixMath.a
- ;
- ; Contains: Fixed Math Interfaces.
- ;
- ; Version: Technology: System 7.5
- ; Release: Universal Interfaces 3.0d3 on Copland DR1
- ;
- ; Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
- ;
- ; Bugs?: If you find a problem with this file, send the file and version
- ; information (from above) and the problem description to:
- ;
- ; Internet: apple.bugs@applelink.apple.com
- ; AppleLink: APPLE.BUGS
- ;
- ;
- IF &TYPE('__FIXMATH__') = 'UNDEFINED' THEN
- __FIXMATH__ SET 1
-
- IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
- include 'Types.a'
- ENDIF
-
- fixed1 EQU $00010000
- fract1 EQU $40000000
- positiveInfinity EQU $7FFFFFFF
- negativeInfinity EQU $80000000
- ;
- ; Previously in ToolUtils.i. Moved here because it makes more sense.
- ;
- IF ¬ OLDROUTINELOCATIONS THEN
- IF FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE THEN
- ;
- ; pascal Fixed FixRatio(short numer, short denom)
- ;
- IF ¬ GENERATINGCFM THEN
- _FixRatio: OPWORD $A869
- ELSE
- IMPORT_CFM_FUNCTION FixRatio
- ENDIF
-
- ;
- ; pascal Fixed FixMul(Fixed a, Fixed b)
- ;
- IF ¬ GENERATINGCFM THEN
- _FixMul: OPWORD $A868
- ELSE
- IMPORT_CFM_FUNCTION FixMul
- ENDIF
-
- ;
- ; pascal short FixRound(Fixed x)
- ;
- IF ¬ GENERATINGCFM THEN
- _FixRound: OPWORD $A86C
- ELSE
- IMPORT_CFM_FUNCTION FixRound
- ENDIF
-
- ENDIF
- ENDIF
- ;
- ; pascal Fract Fix2Frac(Fixed x)
- ;
- IF ¬ GENERATINGCFM THEN
- _Fix2Frac: OPWORD $A841
- ELSE
- IMPORT_CFM_FUNCTION Fix2Frac
- ENDIF
-
- ;
- ; pascal long Fix2Long(Fixed x)
- ;
- IF ¬ GENERATINGCFM THEN
- _Fix2Long: OPWORD $A840
- ELSE
- IMPORT_CFM_FUNCTION Fix2Long
- ENDIF
-
- ;
- ; pascal Fixed Long2Fix(long x)
- ;
- IF ¬ GENERATINGCFM THEN
- _Long2Fix: OPWORD $A83F
- ELSE
- IMPORT_CFM_FUNCTION Long2Fix
- ENDIF
-
- ;
- ; pascal Fixed Frac2Fix(Fract x)
- ;
- IF ¬ GENERATINGCFM THEN
- _Frac2Fix: OPWORD $A842
- ELSE
- IMPORT_CFM_FUNCTION Frac2Fix
- ENDIF
-
- ;
- ; pascal Fract FracMul(Fract x, Fract y)
- ;
- IF ¬ GENERATINGCFM THEN
- _FracMul: OPWORD $A84A
- ELSE
- IMPORT_CFM_FUNCTION FracMul
- ENDIF
-
- ;
- ; pascal Fixed FixDiv(Fixed x, Fixed y)
- ;
- IF ¬ GENERATINGCFM THEN
- _FixDiv: OPWORD $A84D
- ELSE
- IMPORT_CFM_FUNCTION FixDiv
- ENDIF
-
- ;
- ; pascal Fract FracDiv(Fract x, Fract y)
- ;
- IF ¬ GENERATINGCFM THEN
- _FracDiv: OPWORD $A84B
- ELSE
- IMPORT_CFM_FUNCTION FracDiv
- ENDIF
-
- ;
- ; pascal Fract FracSqrt(Fract x)
- ;
- IF ¬ GENERATINGCFM THEN
- _FracSqrt: OPWORD $A849
- ELSE
- IMPORT_CFM_FUNCTION FracSqrt
- ENDIF
-
- ;
- ; pascal Fract FracSin(Fixed x)
- ;
- IF ¬ GENERATINGCFM THEN
- _FracSin: OPWORD $A848
- ELSE
- IMPORT_CFM_FUNCTION FracSin
- ENDIF
-
- ;
- ; pascal Fract FracCos(Fixed x)
- ;
- IF ¬ GENERATINGCFM THEN
- _FracCos: OPWORD $A847
- ELSE
- IMPORT_CFM_FUNCTION FracCos
- ENDIF
-
- ;
- ; pascal Fixed FixATan2(long x, long y)
- ;
- IF ¬ GENERATINGCFM THEN
- _FixATan2: OPWORD $A818
- ELSE
- IMPORT_CFM_FUNCTION FixATan2
- ENDIF
-
- IF GENERATINGPOWERPC THEN
- ;
- ; extern short WideCompare(const wide *target, const wide *source)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION WideCompare
- ENDIF
-
- ;
- ; extern WidePtr WideAdd(wide *target, const wide *source)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION WideAdd
- ENDIF
-
- ;
- ; extern WidePtr WideSubtract(wide *target, const wide *source)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION WideSubtract
- ENDIF
-
- ;
- ; extern WidePtr WideNegate(wide *target)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION WideNegate
- ENDIF
-
- ;
- ; extern WidePtr WideShift(wide *target, long shift)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION WideShift
- ENDIF
-
- ;
- ; extern unsigned long WideSquareRoot(const wide *source)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION WideSquareRoot
- ENDIF
-
- ;
- ; extern WidePtr WideMultiply(long multiplicand, long multiplier, wide *target)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION WideMultiply
- ENDIF
-
- ; returns the quotient
- ;
- ; extern long WideDivide(const wide *dividend, long divisor, long *remainder)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION WideDivide
- ENDIF
-
- ; quotient replaces dividend
- ;
- ; extern WidePtr WideWideDivide(wide *dividend, long divisor, long *remainder)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION WideWideDivide
- ENDIF
-
- ;
- ; extern WidePtr WideBitShift(wide *src, long shift)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION WideBitShift
- ENDIF
-
- ENDIF
- IF GENERATING68K ** ¬ GENERATING68881 THEN
- ;
- ; pascal double_t Frac2X(Fract x)
- ;
- IF ¬ GENERATINGCFM THEN
- _Frac2X: OPWORD $A845
- ELSE
- IMPORT_CFM_FUNCTION Frac2X
- ENDIF
-
- ;
- ; pascal double_t Fix2X(Fixed x)
- ;
- IF ¬ GENERATINGCFM THEN
- _Fix2X: OPWORD $A843
- ELSE
- IMPORT_CFM_FUNCTION Fix2X
- ENDIF
-
- ;
- ; pascal Fixed X2Fix(double_t x)
- ;
- IF ¬ GENERATINGCFM THEN
- _X2Fix: OPWORD $A844
- ELSE
- IMPORT_CFM_FUNCTION X2Fix
- ENDIF
-
- ;
- ; pascal Fract X2Frac(double_t x)
- ;
- IF ¬ GENERATINGCFM THEN
- _X2Frac: OPWORD $A846
- ELSE
- IMPORT_CFM_FUNCTION X2Frac
- ENDIF
-
- ELSE
- ;
- ; pascal double_t Frac2X(Fract x)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION Frac2X
- ENDIF
-
- ;
- ; pascal double_t Fix2X(Fixed x)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION Fix2X
- ENDIF
-
- ;
- ; pascal Fixed X2Fix(double_t x)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION X2Fix
- ENDIF
-
- ;
- ; pascal Fract X2Frac(double_t x)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION X2Frac
- ENDIF
-
- ENDIF
- ENDIF ; __FIXMATH__
-
-